<?php

// +----------------------------------------------------------------------
// | 跨域行为类
// +----------------------------------------------------------------------
// | @author fancsen
// +----------------------------------------------------------------------

namespace app\api\behavior;

class CORS{

    public function appInit(&$params)
    {
        header('Access-Control-Allow-Origin: *');
        header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
        header('Access-Control-Allow-Methods: GET');
        if (request()->isOptions() ){
            exit();
        }
    }
}